package kr.co.thornbacksoft.createadorationdb;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DBHelper extends SQLiteOpenHelper {
	private final String CREATE_ADORATION_TITLE_TABLE = "create table adorationTitle "
			+ "(_id integer primary key, title text, subTitle text);";
	private final String CREATE_ADORATION_BODY_TABLE = "create table adorationBody "
			+ "(_id integer primary key, body text, book text, Page numeric, "
			+ "startLine numeric, endLine numeric, titleId numric);";

	public DBHelper(Context mContextn) {
		super(mContextn, "adoration.db", null, 1);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(CREATE_ADORATION_TITLE_TABLE);
		db.execSQL(CREATE_ADORATION_BODY_TABLE);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("drop table if exists adorationTitle");
		db.execSQL("drop table if exists adorationBody");
		onCreate(db);
	}
}
